// 封装请求
import request from '@/utils/request'

export const login = function (data) {
  return request.post('/user/login', data)
}
export const register = function (data) {
  return request.post('/user/registered', data)
}
// 获取用户的信息资料
export const user = function () {
  return request.get('/user')
}
// 获取用户收藏列表
export const userCollect = function () {
  return request.get('/user/favorites')
}
// 房屋收藏
export const getDetailCollect = function (id) {
  return request.post('/user/favorites/' + id)
}
// 房屋是否收藏
export const getCollect = function (id) {
  return request.get('/user/favorites/' + id)
}
// 房屋删除收藏
export const delCollect = function (id) {
  return request.delete('/user/favorites/' + id)
}
